/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.edu.fundacionincap.VO;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author langeblanc
 */
@Entity
@Table(name = "diahorario", catalog = "AsignacionCarga", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Diahorario.findAll", query = "SELECT d FROM Diahorario d"),
    @NamedQuery(name = "Diahorario.findByIddiaHorario", query = "SELECT d FROM Diahorario d WHERE d.iddiaHorario = :iddiaHorario"),
    @NamedQuery(name = "Diahorario.findByDia", query = "SELECT d FROM Diahorario d WHERE d.dia = :dia")})
public class Diahorario implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 3)
    @Column(name = "iddiaHorario")
    private String iddiaHorario;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 25)
    @Column(name = "dia")
    private String dia;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "dia")
    private Collection<Horario> horarioCollection;

    public Diahorario() {
    }

    public Diahorario(String iddiaHorario) {
        this.iddiaHorario = iddiaHorario;
    }

    public Diahorario(String iddiaHorario, String dia) {
        this.iddiaHorario = iddiaHorario;
        this.dia = dia;
    }

    public String getIddiaHorario() {
        return iddiaHorario;
    }

    public void setIddiaHorario(String iddiaHorario) {
        this.iddiaHorario = iddiaHorario;
    }

    public String getDia() {
        return dia;
    }

    public void setDia(String dia) {
        this.dia = dia;
    }

    @XmlTransient
    public Collection<Horario> getHorarioCollection() {
        return horarioCollection;
    }

    public void setHorarioCollection(Collection<Horario> horarioCollection) {
        this.horarioCollection = horarioCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (iddiaHorario != null ? iddiaHorario.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Diahorario)) {
            return false;
        }
        Diahorario other = (Diahorario) object;
        if ((this.iddiaHorario == null && other.iddiaHorario != null) || (this.iddiaHorario != null && !this.iddiaHorario.equals(other.iddiaHorario))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "co.edu.fundacionincap.VO.Diahorario[ iddiaHorario=" + iddiaHorario + " ]";
    }
    
}
